package krillr.Util;

/**
 * Point2d - 2D point location base on the work by Coy J Krill
 * 
 * @author Aaron M. Krill
 * @version 0.1
 */
public class Point2d extends java.awt.geom.Point2D.Double {
    /**
     * Constructs a point at the specified x and y coordinates.
     * 
     * @param x - x coordinate for the new point
     * @param y - y coordinate for the new point
     */
    public Point2d(double x, double y) {
        super(x, y);
    }
    
    /**
     * Constructs a point at the same location as the specified point.
     * 
     * @param p - p the point to initialize the point at
     */
    public Point2d(Point2d p) {
        super(p.x, p.y);
    }
     /**
     * Applies a specified force vector to this point displacing it in space.
     * 
     * @param v - force vector to affect this point
     */
    public Point2d applyVector(Vector2d v) {
        return new Point2d(x + v.x, y + v.y);
    }
}